package real.utils;

import java.util.ArrayList;

public class RealEvent {

	private ArrayList<RealEventHandler> handlers = new ArrayList<RealEventHandler>();

	public void addHandler(RealEventHandler handler)
	{
		handlers.add(handler);
	}
	
	public void removeHandler(RealEventHandler handler)
	{
		handlers.remove(handler);
	}
	
	public void fire(RealEventArgs e) throws Exception 
	{
		for (RealEventHandler handler : this.handlers)
		{
			handler.perfomAction(e);
		}		
	}
	
	public void clear()
	{
		this.handlers.clear();
	}
	
}
